<div class="row-content am-cf">
    <div class="row">
        <div class="am-u-sm-12 am-u-md-12 am-u-lg-12">
            <div class="widget am-cf">
                <div class="widget-head am-cf">
                    <div class="widget-title am-cf">开发成员管理</div>
                </div>
                <div class="widget-body am-fr">
                    <div class="am-u-sm-12 am-u-md-6 am-u-lg-6">
                        <div class="am-form-group">
                            <div class="am-btn-toolbar">
                                <div class="am-btn-group am-btn-group-sm">
                                    <a href="javascript:void(0);" class="hema-add am-btn am-btn-primary am-radius" >
                                        <span class="am-icon-plus"></span> 添加
                                    </a>
                                </div>
                            </div>
                        </div>
                    </div>
                    <div class="am-u-sm-12">
                        <table width="100%" class="am-table am-table-hover tpl-table-black">
                            <thead>
                            <tr>
                                <th>用户ID</th>
                                <th>支付宝账号</th>
                                <th>成员角色</th>
                                <th>成员状态</th>
                                <th>管理操作</th>
                            </tr>
                            </thead>
                            <tbody>
                            {if $list['code']==10000 AND isset($list['app_member_info_list'])}
                                {foreach $list['app_member_info_list'] as $item}
                                <tr>
                                    <td class="am-text-middle">
                                        <p>{$item['user_id']}</p>
                                    </td>
                                    <td class="am-text-middle">{$item['logon_id']}</td>
                                    <td class="am-text-middle">
                                        {$item['role']=='MANAGER'?'管理员':''}
                                        {$item['role']=='DEVELOPER'?'开发者':''}
                                        {$item['role']=='EXPERIENCER'?'体验者':''}
                                    </td>
                                    <td class="am-text-middle">
                                        {$item['status']=='VALID'?'有效':''}
                                        {$item['status']=='UNCONFIRMED'?'未确认':''}
                                        {$item['status']=='TIMEOUT'?'已失效':''}
                                        {$item['status']=='REFUSED'?'用户拒绝':''}
                                    </td>
                                    <td class="am-text-middle">
                                        <div class="tpl-table-black-operation">
                                            <a href="javascript:;" class="item-del tpl-table-black-operation-del"
                                               data-id="{$item['user_id']}" 
                                               data-role="{$item['role']}">
                                                <i class="am-icon-trash"></i> 删除
                                            </a>
                                        </div>
                                    </td>
                                </tr>
                                {/foreach}
                            {else /}
                                <tr>
                                    <td colspan="3" class="am-text-center">
                                        {$list['code'] == 10000 ? '暂无记录' : 'code：'.$list['sub_code'].'，msg：'.$list['sub_msg']}
                                    </td>
                                </tr>
                            {/if}
                            </tbody>
                        </table>
                    </div>
                </div>
            </div>
        </div>
    </div>
</div>
{include file="alipay/member/add" /}
<script>
    $(function () {
         //添加
        $('.hema-add').on('click', function () {
            $.showAction({
                title: '添加', 
                area: '750px', 
                content: template('tpl-add', {}), 
                uCheck: true, 
                success: function ($content) {
                    $('#my-form').formPost({
                        url: "{:url('alipay.member/add')}"
                    });
                }, 
                btn2: function ($content) {
                    return true;
                }
            });
        });
        $('.item-del').on('click', function () {
            var data = $(this).data();
            var url = "{:url('alipay.member/delete')}?role=" + data.role;
            // 删除元素
            $('.item-del').del('id', url);
        });
    });
</script>